<?php
namespace app\admin\controller;

use app\BaseController;
use app\common\business\mysql\CommonCityConfig as serviceModel;

class CommonCityConfig extends BaseController
{

    /*
     * 加载省市数据
     */
    public function listAll(){
        $data = [
            'lists' => serviceModel::getListAll()
        ];
        jsonSuccess($data);
    }

    public function list(){
        $fildes = 'page';
        $receiveData = getData($this->request->post(),$fildes);
        if(empty($receiveData['page'])){
            $receiveData['page'] = 1;
        }
        $limit_start = ($receiveData['page']-1) * env('page_size');
        $data = [
            'lists' => serviceModel::getList($limit_start,env('page_size')),
            'allpage' => serviceModel::getCount()
        ];
        jsonSuccess($data);
    }

}
